﻿using System;
using System.Data;
using Home.Haushalt.Lib.Element;
using Home.Haushalt.Lib;

namespace Home.Haushalt.Gui
{
    /// <summary>
    /// 
    /// </summary>
    public partial class FrmPropertyFinDate : FrmProperty
    {
        /// <summary>
        /// 
        /// </summary>
        public FrmPropertyFinDate()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Base.Init initialisiert txtDesc mit dem falschen Feld-Namen
        /// </summary>
        /// <param name="row"></param>
        protected override void Init(DataRow row)
        {
            ElementObject=ElementBase.Instantiate(row);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmPropertyFinDate_Load(object sender, EventArgs e)
        {
            AddBinding(txtDesc.DataBindings, "Text", FinDate.Fields.PackedPaymtPurpose);

            AddBinding(txtBR.DataBindings, "Text", FinDate.Fields.BankRef);
            AddBinding(txtC.DataBindings, "Text", FinDate.Fields.Currency);
            AddBinding(txtCI.DataBindings, "Text", FinDate.Fields.CreditorId);
            AddBinding(txtDV.DataBindings, "Text", FinDate.Fields.DecValue);
            AddBinding(txtED.DataBindings, "Text", FinDate.Fields.EntryDate);
            AddBinding(txtET.DataBindings, "Text", FinDate.Fields.EntryText);
            AddBinding(txtETEI.DataBindings, "Text", FinDate.Fields.EndToEndId);
            AddBinding(txtFC.DataBindings, "Text", FinDate.Fields.FundsCode);
            AddBinding(txtMI.DataBindings, "Text", FinDate.Fields.MandateId);
            AddBinding(txtOR.DataBindings, "Text", FinDate.Fields.OwnerRef);
            AddBinding(txtPNN.DataBindings, "Text", FinDate.Fields.PrimaNotaNo);
            AddBinding(txtPPAN.DataBindings, "Text", FinDate.Fields.PayeePayerAcctNo);
            AddBinding(txtPPBC.DataBindings, "Text", FinDate.Fields.PayeePayerBankCode);
            AddBinding(txtPPN1.DataBindings, "Text", FinDate.Fields.PayeePayerName1);
            AddBinding(txtPPN2.DataBindings, "Text", FinDate.Fields.PayeePayerName2);
            AddBinding(txtSD.DataBindings, "Text", FinDate.Fields.SupplementaryDetails);
            AddBinding(txtTKE.DataBindings, "Text", FinDate.Fields.TextKeyExt);
            AddBinding(txtTTIC.DataBindings, "Text", FinDate.Fields.TranTypeIdCode);
            AddBinding(txtVD.DataBindings, "Text", FinDate.Fields.ValueDate);
            AddBinding(txtZTC.DataBindings, "Text", FinDate.Fields.ZkaTranCode);

            DataBind();
        }

    }
}
